package com.hu.core.util;

import java.io.IOException;
import java.io.InputStream;
import java.util.Properties;

import com.hu.example.Constants;

public class PropertyUtil {
    private static Properties properties = null;
    static {
        InputStream inputStream = null;
        properties = new Properties();
        try {
            inputStream = PropertyUtil.class.getClassLoader().getResourceAsStream(Constants.PROP_PATH);
            properties.load(inputStream);
        } catch (IOException e) {
            e.printStackTrace();
        } finally {
            if (null != inputStream) {
                try {
                    inputStream.close();
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
        }
    }

    public static String getProperty(String key) {
        return properties.getProperty(key);
    }
}
